<?php
	require_once("conexion/conexion.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Formulario Busqueda</title>
<link href="Estilos/global.css" rel="stylesheet" type="text/css" />
<link href="Estilos/local.css" rel="stylesheet" type="text/css" />
<link href="Estilos/CssTabla3.css" rel="stylesheet" type="text/css" />

<script src="include_js/jquery.js" type="text/javascript"></script>

<script>
function Cargar(valor,url,contenedor)
{
    x=document.getElementById(contenedor);
        $.ajax
		({
            type: 'POST',
            url: url,
            data: {valor: valor},
            success: function(data)
			{
                $(x).html(data);
            }
        })
}
</script>

</head>

<body>
<form name="form_Busqueda_Decl" id="form_Busqueda_Decl" method="post">
<table width="100%" border="0" cellpadding="0">
  <tr>
    <td>
	<div class='option2'><label style="font:Verdana, Arial, Helvetica, sans-serif; color:#0066CC; font-weight:bold;">Secci&oacute;n de busqueda.</label></div>
	<div class='groupbox'>
		<table width="100%" border="0" class="tres" cellpadding="0" cellspacing="0">
  <tr style="border:1px solid #6593C0;">
    <td width="25%" style="border:1px solid #6593C0;"><label style="color:#FFFFFF; font-weight:bold;">N&deg; Factura</label></td>
    <td width="54%" style="border:1px solid #6593C0;"><label style="color:#FFFFFF; font-weight:bold;">Fecha Desde</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<label style="color:#FFFFFF; font-weight:bold;">Fecha Hasta</label></td>
    <td width="21%" style="border:1px solid #6593C0;">&nbsp;</td>
  </tr>
  <tr style="border:1px solid #6593C0;">
    <td style="border:1px solid #6593C0;"><input type="text" name="txtFactura" id="txtFactura" /></td>
    <td style="border:1px solid #6593C0;"><input name="txtFIni" type="text" id="txtFIni" size="10">&nbsp;<img src="imagen/img.gif" width="20" height="14" title="calendario" style="cursor: pointer; border: 1px solid green;" onmouseover="this.style.background='black';" onmouseout="this.style.background=''" onclick="popUpCalendar(txtFIni, form_Busqueda_Decl.txtFIni, 'dd-mm-yyyy');" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<input name="txtFFin" type="text" id="txtFFin" size="10">&nbsp;<img src="imagen/img.gif" width="20" height="14" title="calendario" style="cursor: pointer; border: 1px solid green;" onmouseover="this.style.background='black';" onmouseout="this.style.background=''" onclick="popUpCalendar(txtFFin, form_Busqueda_Decl.txtFFin, 'dd-mm-yyyy');" /></td>
    <td style="border:1px solid #6593C0;"><input type="button" name="btn_Buscar_Otros" id="btn_Buscar_Otros" value=" " class="buscar" /></td>
  </tr>
  <tr style="border:1px solid #6593C0;">
    <td style="border:1px solid #6593C0;" colspan="2"><label style="color:#FFFFFF; font-weight:bold;">Cliente</label></td>
    <td style="border:1px solid #6593C0;">&nbsp;</td>
  </tr>
  <tr style="border:1px solid #6593C0;">
    <td style="border:1px solid #6593C0;" colspan="3">
	<select name="cmb_Cliente" id="cmb_Cliente">
        <option value="0">--CLIENTE--</option>
        <?php
            	$con = new Conexion();
        		$con2 = $con->conexionBD("fpproduccion");
                $sql = "select OCliRut,OCliRSocial from otrosclientes where 1 order by OCliRSocial";
                $resultado = mysql_query($sql) or die ($con->error_mysql("Error en la consulta".mysql_error()));
				//$fila = mysql_num_rows($resultado);
				while ($row = mysql_fetch_row($resultado))
				{
					$dato = utf8_decode($row[1]);
					echo "<option value='".$row[0]."'>".$dato."</option>";
				}
                $con->cerrarBD();
	  ?>
      </select>
	</td>
  </tr>
</table>
</div>			
    </td>
  </tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
	<td><div id="capa"></div></td>
</tr>
</table>
</form>
</body>
<script>
$('#btn_Buscar_Otros').click(function() 
{ 
        $.ajax({
            type: 'POST',
            url: 'Contabilidad/carga_busqueda_factura_otros.php',
            data: $('#form_Busqueda_Decl').serialize(),
            success: function(data) {
                $('#capa').html(data);
            }
        })
});
</script>
</html>